﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Diagnostics;

/// <summary>
/// Summary description for Player
/// </summary>
public class Player
{
    public int playerID { get; set; }
    public String playerName { get; set; }
    public String teamName { get; set; }
    public int realTeamID { get; set; }
    public Team team { get; set; }
    public Position position { get; set; }
    public bool substitute;

    public Player()
    {
    }


    public void moveToBench(Player sub)
    {
        if (validSubstitution(sub))
        {
            this.substitute = true;
            sub.substitute = false;
        }
    }

    private bool validSubstitution(Player sub)
    {
        return sub.substitute == true && this.substitute == false;
    }

    public void setRealTeam()
    {
        team = (Team)realTeamID;
    }

}